import {Component, EventEmitter, Input, Output} from '@angular/core';
import {FormsModule} from "@angular/forms";

@Component({
    selector: 'app-child',
    standalone: true,
    imports: [FormsModule],
    templateUrl: './child.component.html',
    styleUrl: './child.component.css'
})
export class ChildComponent {
    @Input() childrenName: string = 'child';

    @Input() count: number = 0;


    childrenValue: string = "这是子组件的值";
    @Output() private cry: EventEmitter<string> = new EventEmitter();

    @Output() private happy: EventEmitter<string> = new EventEmitter();

    doSend() {
        this.cry.emit(this.childrenValue);
    }

    doSend2(val: string) {
        console.log("val ===", val)
        this.happy.emit(val);
    }


}
